home *** CD-ROM | disk | FTP | other *** search
- -- P.B.A.R --
-
-
- Have you ever wondered where your
-
- BASIC programs are stored in memory?
-
- This article is designed to help you
-
- understand that, as well as utilize
-
- some extraordinary storage
-
- capabilities of the C-64.
-
- On this issue of LOADSTAR, after the
-
- Paperless Pages or the INFLUX sections
-
- load once, further loadings of these
-
- sections take far less time. This is
-
- due to a small trick that I call
-
- 'P.B.A.R.', which is short for- 'PRO-
-
- GRAM BURIAL AND RETRIEVAL'.
-
- First of all, there are two memory
-
- locations in your C-64 which are very
-
- important for this trick. These
-
- locations are 43 and 44.
-
- During normal operation, if you do
-
- this:
- >print peek(43),peek(44)
-
- you should get this:
-
- > 1 8
-
- These two values (1,8) are the normal
-
- values for the pointer which tells the
-
- computer where to find the BOTTOM of
-
- BASIC STORAGE.
-
- In the Commodore Programmer's Ref-
-
- erence guide, page 320, it is stated
-
- that the NORMAL BASIC PROGRAM SPACE
-
- is located from 2048-40959.
-
- Now, if you take your two previous
-
- values and do this:
-
- >print 1+8*256
-
- which is the same as:
-
- >print peek(43)+peek(44)*256
-
- you should get:
-
- >2049
-
- which was just stated to be the
-
- BOTTOM of BASIC STORAGE.
-
- When you load a program into your
-
- computer, it is stored starting at
-
- 2049. Now if we change the pointers
-
- (locations 43 & 44) to make the
-
- computer think basic is elsewhere,
-
- then that's where the computer will
-
- put your program. The address where
-
- your program is loaded can be found by
-
- the formula we used above. HINT:
-
- it looks like this:
-
- >print peek(xx)+peek(xx)*256
-
- The locations are changed by using
-
- a statement like this:
-
- >poke43,xx:poke44,xx
-
- For the Paperless Pages and INFLUX, I
-
- used the statement:
-
- >poke43,1:poke44,25
-
- and then loaded the appropriate pro-
-
- gram. The actual address where the
-
- computer will start to load the
-
- program is:
-
- >print 1+25*256
-
- or
-
- > 6401
-
- This tells the computer to start
-
- loading at 6401 insted of the normal
-
- 2049.
-
- -------------(continued)--------------
- (x to exit)
-